<!DOCTYPE html>
<html>

<head>
    <title></title>
    <#include "/header.html">

        <style>
            .dib {
                display: inline-block;
            }

            .tac {
                text-align: center;
            }

            .content {
                padding: 10px 0;
                padding-left: 4px;
                border: 1px solid #ccc;
            }

            .content li {
                padding: 5px 0;
            }

            .content li>div {
                height: 34px;
                line-height: 34px;    
                padding: 0;
                text-align: center;
            }

            .content .title p {
                padding: 0 15px;
            }

            .note-editable.panel-body {
                height: 90px!important;
            }
        </style>
</head>

<body>
    <div id="rrapp" v-cloak>
        <div v-show="showList">
        
        	<div class="panel panel-default">
        	
        		<div class="panel-heading">
					<span id="panelTitle"><i class="fa fa-search"
						style="font-size: 16px; color: #3c8dbc;"></i><span class="pl03">查询操作</span></span>
					<div class="fr pr10">
						<span class="pr20"> <a href="javascript:;"
							class="btn btn-default btn-sm"
							style="margin-top: -8px; padding-left: 20px" @click="query">查询</a>
							<i class="fa fa-search"></i> <a href="javascript:;"
							class="btn btn-default btn-sm"
							style="margin-top: -8px; padding-left: 20px" @click="reset">重置</a>
							<i class="fa fa-exchange"></i>
						</span> <span> <a href="javascript:;"
							onclick="collapsePanel('collapseAction','searchBody');"
							style="outline: none;"><i id="collapseAction"
								class="fa fa-arrow-circle-o-up" style="font-size: 22px;"></i><i
								class="fa fa-arrow-circle-o-down" style="display: none;"></i></a>
						</span>
						</div>
				</div>
				
				
				<div class="panel-body" id="searchBody">
						<div class="search-wrapper clearfix" style="margin-bottom: 0px;">
							<ul class="clearfix">
								<li>
									<div class="form-group">
										<label>专业</label> 
										<select v-model="q.majorId" @change="selectChangeHandlerSections" class="form-control" placeholder="隶属专业">
										    <option v-for="item in majorLists" v-bind:value="item.id">{{item.majorName}}</option>
										 </select>
									</div>
								</li>
								
								<li>
									<div class="form-group">
										<label>章&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;节</label> 
											<select v-model="q.sectionId"  class="form-control" placeholder="隶属章节">
											    <option v-for="item in sectionLists" v-bind:value="item.id">{{item.sectionName}}</option>
										 	</select>
									</div>
								</li>
							
							</ul>
							<div class="button-group"></div>
						</div>
					</div>
        	
        
	            <div class="grid-btn">
	                <#if shiro.hasPermission( "exam:equestionmanagement:save")>
	                    <a class="btn btn-primary" @click="add">
	                        <i class="fa fa-plus"></i>&nbsp;新增</a>
	                </#if>
	                <#if shiro.hasPermission( "exam:equestionmanagement:update")>
	                    <a class="btn btn-primary" @click="update">
	                        <i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
	                </#if>
	                <#if shiro.hasPermission( "exam:equestionmanagement:delete")>
	                    <a class="btn btn-primary" @click="del">
	                        <i class="fa fa-trash-o"></i>&nbsp;删除</a>
	                </#if>
	                <!-- <#if shiro.hasPermission("exam:equestionmanagement:import")>
	                    <a class="btn btn-primary" ><label for="file" style="margin-bottom: 0px;"><i class="fa fa-file-excel-o"></i>&nbsp;导入</label></a>
						<input id="file" name="file" type="file" style="display:none" @change="impo()"/>
	                </#if> -->
	                <#if shiro.hasPermission( "exam:equestionmanagement:import")>
	                    <a class="btn btn-primary" @click="imports">
	                        <i class="fa fa-pencil-square-o"></i>&nbsp;导入</a>
	                </#if>
	                <#if shiro.hasPermission("exam:equestionmanagement:download")>
	                    <a class="btn btn-primary" @click="download"><label  style="margin-bottom: 0px;"><i class="fa fa-file-excel-o"></i>&nbsp;下载</label></a>
	                </#if>
	            </div>
	            <table id="jqGrid"></table>
	            <div id="jqGridPager"></div>
            
            </div>
        </div>

        <div v-show="showListTable" class="panel panel-default">
            <div class="panel-heading">{{title}}</div>
            <form class="form-horizontal clearfix">
                <div class="form-group col-md-6">
                    <div class="col-sm-2 control-label">试题内容</div>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" v-model="eQuestionManagement.content" placeholder="试题内容" />
                    </div>
                </div>
                <div class="form-group col-md-6">
                    <div class="col-sm-2 control-label">试题等级</div>
                    <div class="col-sm-10">
                        <!-- <input type="text" class="form-control" v-model="eQuestionManagement.grade" placeholder="试题等级" /> -->
                   		 <select v-model="eQuestionManagement.grade"  class="form-control" placeholder="试题等级">
						    <option value="1">简单</option>
						    <option value="2">中等</option>
						    <option value="3">极难</option>
					 </select>
                    </div>
                </div>
                <div class="form-group col-md-6">
                    <div class="col-sm-2 control-label">隶属专业</div>
                     <div class="col-sm-10">
                     	 <select v-model="eQuestionManagement.majorId" @change="selectChangeHandlerSection" class="form-control" placeholder="隶属专业">
						    <option v-for="item in majorLists" v-bind:value="item.id">{{item.majorName}}</option>
						 </select>
                     </div>
                </div>
                 <div class="form-group col-md-6">
                    <div class="col-sm-2 control-label">隶属章节</div>
                    <div class="col-sm-10">
                        <!-- <input type="text" class="form-control" v-model="eQuestionManagement.sectionId" placeholder="章节Id" /> -->
                    	<select v-model="eQuestionManagement.sectionId"  class="form-control" placeholder="隶属章节">
						    <option v-for="item in sectionLists" v-bind:value="item.id">{{item.sectionName}}</option>
					 	</select>
                    </div>
                </div>
         <!--        <div class="form-group col-md-6">
                    <div class="col-sm-2 control-label">试题类型</div>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" v-model="eQuestionManagement.typeId" placeholder="试题类型" />
                    </div>
                </div> -->
                
                <div class="form-group col-md-6" id="app">
					<div class="col-sm-2 control-label">试题类型</div> 	
					<div class="col-sm-10">
						 <select v-model="eQuestionManagement.typeId" @change="selectChangeHandler" class="form-control" placeholder="试题类型">
						    <option v-for="item in typeLists" v-bind:value="item.questionTypeNumber" >{{item.questionTypeName}}</option>
						 </select>
                    </div>
				</div>
                <div v-if="showAnswerOptions" class="form-group col-md-6">
                    <!-- 单选题 多选题  -->
                    <label class="col-sm-2 control-label">设置选项：</label>
					<div v-if="eQuestionManagement.typeId == '003'"  class="options col-sm-10" style="padding-top: 7px;">
						<span style="margin-right: 20px;">
							<input id="input_t" type="radio" name="panduan" v-model="answer" value="T"><label for="input_t" >T</label>
						</span>
						<input id="input_f" type="radio" name="panduan" v-model="answer" value="F"><label for="input_f" >F</label>
					</div>
                    <div v-else  class="options col-sm-10">
                        <style>
                        </style>
                        <div class="content">
                            <div class="title">
                                <p class="tac col-xs-6 col-md-6">选项文字</p>
                                <p class="tac col-xs-3 col-md-3">答案</p>
                                <p class="tac col-xs-3 col-md-3">操作</p>
                            </div>
                            <ul class="options-list">
                                <li class="clearfix item" v-for="(item, index) in options">
                                    <div class="col-xs-6 col-md-6">
                                        <div class="input-group">
                                            <div class="input-group-addon">{{ item.ABC }}</div>
                                            <input type="text" class="form-control" v-bind:placeholder="item.placeholder" v-model="item.value">
                                        </div>
                                    </div>
                                    <div class="tac col-xs-3 col-md-3">
                                        <input v-if="eQuestionManagement.typeId == '001'" type="radio" v-model="answer" v-bind:value="item.ABC">
                                        <input v-else type="checkbox" v-model="answer" v-bind:value="item.ABC">
                                    </div>
                                    <div class="col-xs-3 col-md-3">
                                        <button type="button" class="btn btn-success btn-add" v-on:click="addOption(index)" title="增加选项">+</button>
                                        <button type="button" class="btn btn-danger btn-del" v-on:click="delOption(index)" title="删除选项">-</button>
                                    </div>
                                </li> 
                            </ul>
                        </div>
                    </div>
                </div>
       
                <div class="form-group col-md-6">
                    <div class="col-sm-2 control-label"></div>
                    <input type="button" class="btn btn-primary" @click="getData" value="确定" /> &nbsp;&nbsp;
                    <input type="button" class="btn btn-warning" @click="reload" value="返回" />
                </div>
            </form>
        </div>
        
        
        <div v-show="allHide" class="panel panel-default">
            <div class="panel-heading">{{title}}</div>
            <form class="form-horizontal clearfix">
           
                <div class="form-group col-md-6">
                    <div class="col-sm-2 control-label">隶属专业</div>
                     <div class="col-sm-10">
                     <select v-model="eQuestionManagement.majorId" @change="selectChangeHandlerSection" class="form-control" placeholder="隶属专业">
						    <option v-for="item in majorLists" v-bind:value="item.id">{{item.majorName}}</option>
						 </select>
                     </div>
                </div>
                <div class="form-group col-md-6">
                    <div class="col-sm-2 control-label">隶属章节</div>
                    <div class="col-sm-10">
                        <!-- <input type="text" class="form-control" v-model="eQuestionManagement.sectionId" placeholder="章节Id" /> -->
                    <select v-model="eQuestionManagement.sectionId"  class="form-control" placeholder="隶属章节">
						    <option v-for="item in sectionLists" v-bind:value="item.id">{{item.sectionName}}</option>
					 </select>
                    </div>
                </div>
                <div class="form-group col-md-6">
                    <div class="col-sm-2 control-label">选择题库</div>
                    <div class="col-sm-10">
                        <input id="file" name="file" type="file"/>
                    </div>
                </div>
           
                <div class="form-group col-md-6">
                    <div class="col-sm-2 control-label"></div>
                    <input type="button" class="btn btn-primary" @click="impo" value="确定" /> &nbsp;&nbsp;
                    <input type="button" class="btn btn-warning" @click="reload" value="返回" />
                </div>
            </form>
        </div>
        
    </div>

    <script src="${request.contextPath}/statics/js/modules/exam/equestionmanagement.js?_${.now?long}"></script>
</body>

</html>